home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / expandpath.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.5 KB  |  56 lines

  1. <!--- This example shows the use of ExpandPath --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>
  5. ExpandPath Example
  6. </TITLE>
  7. </HEAD>
  8.  
  9. <BODY  bgcolor="#FFFFD5">
  10. <H3>ExpandPath Example</H3>
  11.  
  12. This file has been disabled for online viewing.  Please use your
  13. copy of ColdFusion to view this example.
  14. <!---
  15. <CFSET thisPath=ExpandPath("*.*")>
  16. <CFSET thisDirectory=GetDirectoryFromPath(thisPath)>
  17. <CFOUTPUT>
  18. The current directory is: #GetDirectoryFromPath(thisPath)#
  19.  
  20. <CFIF IsDefined("form.yourFile")>
  21. <CFIF form.yourFile is not "">
  22. <CFSET yourFile = form.yourFile>
  23.     <CFIF FileExists(ExpandPath(yourfile))>
  24.     <P>Your file exists in this directory.  You entered
  25.     the correct file name, #GetFileFromPath("#thisPath#/#yourfile#")#
  26.     <CFELSE>
  27.     <P>Your file was not found in this directory:
  28.     <BR>Here is a list of the other files in this directory:
  29.     <!--- use CFDIRECTORY to give the contents of the
  30.     snippets directory, order by name and size --->
  31.     <CFDIRECTORY DIRECTORY="#thisDirectory#"
  32.     NAME="myDirectory"
  33.     SORT="name ASC, size DESC">
  34.     <!--- Output the contents of the CFDIRECTORY as a CFTABLE --->    
  35.     <CFTABLE QUERY="myDirectory">
  36.     <CFCOL HEADER="NAME:"
  37.             TEXT="#Name#">
  38.     <CFCOL HEADER="SIZE:"
  39.             TEXT="#Size#">
  40.     </CFTABLE>
  41.     </CFIF>
  42. </CFIF>
  43. <CFELSE>
  44. <H3>Please enter a file name</H3>
  45. </CFIF>
  46. </CFOUTPUT>
  47.  
  48. <FORM action="expandpath.cfm" METHOD="post">
  49. <H3>Enter the name of a file in this directory <I><FONT SIZE="-1">(try expandpath.cfm)</FONT></I></H3>
  50. <INPUT TYPE="Text" NAME="yourFile">
  51. <INPUT TYPE="Submit" NAME="">
  52. </FORM>
  53.  --->
  54. </BODY>
  55. </HTML>       
  56.